<!--
  Generated template for the SearchPage page.

  See http://ionicframework.com/docs/components/#navigation for more info on
  Ionic pages and navigation.
-->
<ion-header>

  <ion-navbar>
    <ion-searchbar [(ngModel)]="keywords"></ion-searchbar>

    <ion-buttons end>
      <button ion-button (tap)='getSearchList()'>
         搜索
      </button>
    </ion-buttons>
  </ion-navbar>

</ion-header>


<ion-content>


  <div class="search_content" *ngIf="!flag">

      <div class="hotlist">
          
              <h3 class="search_title">热搜</h3>
          
              <p>
                <span>女装</span>
                <span>男装</span>
                <span>家具</span>
                <span>化妆品</span>
                <span>女装</span>    
              </p>
          
            </div>
          
            <div class="history" *ngIf="historyList.length>0">
              
                 <h3 class="search_title">历史搜索</h3>
                 <!-- 事件http://ionicframework.com/docs/components/#gestures -->
                 <ion-list inset >
                   <ion-item *ngFor="let item of historyList" (press)="removeHistory(item)" (tap)="goSearch(item)">
                      {{item}}
                   </ion-item>
                
                 </ion-list>
              
            </div>

  </div>
  


  <div class="list_content"  *ngIf="flag">

      <div class="sub_header">
          <div>综合</div>
          <div>销量</div>
          <div>价格</div>          
      </div>

       <ion-list inset>
        <ion-item *ngFor="let item of list" >
          <ion-thumbnail item-left>
             <img [src]="config.apiUrl+item.s_pic"  />            
          </ion-thumbnail>
          <h2> {{item.title}}</h2>
          <p>价格:<span class="price">{{item.price}}</span>元</p>           
        </ion-item>
       </ion-list>


       <ion-infinite-scroll (ionInfinite)="doLoadMore($event)" *ngIf="hasData">
        <ion-infinite-scroll-content></ion-infinite-scroll-content>
      </ion-infinite-scroll>
  </div>

</ion-content>
